<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<%@ page import="java.util.List" %> 
<%@ page import="git.cognos.pojo.HistoryPage"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/ext/core/ext/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/ext/core/extra/css/button.css" />
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/ext/core/extra/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/style.css" />
	
<script type="text/javascript"
	src="<%=request.getContextPath()%>/ext/core/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/ext/core/ext/ext-all.js"></script>
	
	<script type="text/javascript"
	src="<%=request.getContextPath()%>/ext/core/extra/DeptTree.js"></script>
	
	</head>
	<body  >
			
			<!-- 
			<table style="position: absolute;top: 10px;left: 15px;" border="0" cellspacing="0" cellpadding="0" id="test1"">
				<tbody id="test2">
					<tr style="height: 26px;width: 180px;"><td background="<%=request.getContextPath()%>/images/ns.gif"></td></tr>
					 
					<tr><td><img src="<%=request.getContextPath()%>/images/n1.gif"></td></tr>
					<tr><td><img src="<%=request.getContextPath()%>/images/n2.gif"></td></tr>
					<tr><td><img src="<%=request.getContextPath()%>/images/n3.gif"></td></tr>
					<tr><td><img src="<%=request.getContextPath()%>/images/n4.gif"></td></tr>
					<tr><td><img src="<%=request.getContextPath()%>/images/n5.gif"></td></tr>
					<tr><td><img src="<%=request.getContextPath()%>/images/n6.gif"></td></tr>
					<tr><td><img src="<%=request.getContextPath()%>/images/n-f.gif"></td></tr>
				 
				</tbody>
			</table>
			-->
			
			<table style="position: absolute;" height="100%" width="100%" align="center"   cellspacing="0" cellpadding="0">
				 
				<tr >
					<td>
						<!-- <img src="<%=request.getContextPath()%>/images/fous_10.gif" style="height: 242px;width: 570px"> -->
						<!-- <iframe frameborder="0" border="0" marginheight="0" marginwidth="0" height="400px" width="830px" src="<%=request.getAttribute("defaultPage")%>"></iframe> -->
						<iframe frameborder="0" height="100%" width="100%" src="<%=request.getAttribute("defaultPage")%>"></iframe>
					</td>
				</tr>
			</table>
			
	</body>
	<script>
		var userid='<%=oLogon.getUsername()%>';
		function openWin(e){
			e = e || window.event;
			var src = e.target || e.srcElement;
			window.location = src.title;
		}
		function confirmMessage(e){
			var question = confirm("确实要删除当前项吗？");
			if(question){
				delElement(e);
			}
		}
		function delElement(e){
			
			e = e || window.event;
			var src = e.target || e.srcElement;
			var parent = src.parentNode;
			var id = parent.id;
			//alert(id);
			var childNodes = parent.childNodes;
			var length = childNodes.length;
			var urlPath = childNodes[0].href; 

			//异步从数据库中删除
			Ext.Ajax.request( {
			    url :'/bidevapp/center.do?action=deleteShortcutByID&id='+id,
			    success : function(response) {
			      var resobject = eval("(" + response.responseText + ")");
			      if(resobject.success){
			    	  for(var i=0; i<length; i++){
							parent.removeChild(childNodes[0]);
						}
						var temp = parent;
						parent = parent.parentNode;
						parent.removeChild(temp);
			    	  Ext.Msg.alert('删除成功！');
				  }else{
					  Ext.Msg.alert('删除失败！');
				  }
			    },
			    failure : function(response) {
			      Ext.Msg.alert('删除失败！');
			    }
			  });
			
		}
	/*
		var etab = document.getElementById("test1");
		var eTbody = document.getElementById("test2");
		var i = 1;
		<%
			List<HistoryPage> loadlist = (List<HistoryPage>)request.getAttribute("loadlist");
			
			for(HistoryPage historyPage: loadlist){
		%>		
				var eTr1 = document.createElement("tr");
				var eTd1 = document.createElement("td");

				var div = document.createElement("div");
				div.title="<%=historyPage.getPageName()%>";
				div.id=<%=historyPage.getId()%>;
				div.className='menudiv'+i;
				i++;

				var a = document.createElement("a");
				a.href="<%=historyPage.getPagePath()%>";

				//当字符较长时，截取前4位
				<%if(historyPage.getPageName().length() > 4){%>
					a.innerHTML="<%=request.getAttribute("blankStr")+historyPage.getPageName().substring(0,4)+"..."%>";
				<%}else{%>
					a.innerHTML="<%=request.getAttribute("blankStr")+historyPage.getPageName()%>";
				<%}%>
				
				a.title="<%=historyPage.getPageName()%>";
				

				//删除图标
				var delImg1 = document.createElement("img");
				delImg1.src="<%=request.getContextPath()%>/images/fous_24.gif";
				delImg1.title="删除";
				delImg1.onclick=confirmMessage;
				div.appendChild(delImg1);
				div.appendChild(a);


				eTd1.appendChild(div);
				eTr1.appendChild(eTd1);

				eTbody.appendChild(eTr1);
				
		<%}%>
		etab.appendChild(eTbody);
*/
	</script>
</html>